import request from '@/utils/requset'

export const getDetailService = (id: string) => {
  return request.get('/goods', {
    params: {
      id
    }
  })
}

/**
 * 获取热榜商品
 * @param {Number} id - 商品id
 * @param {Number} type - 1代表24小时热销榜 2代表周热销榜
 * @param {Number} limit - 获取个数
 */
interface IGetHotGoodsService {
  id: number
  type: number
  limit?: number
}
export const getHotGoodsService = ({
  id,
  type,
  limit = 3
}: IGetHotGoodsService) => {
  return request.get('/goods/hot', {
    params: {
      id,
      type,
      limit
    }
  })
}
